<!DOCTYPE html>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="textml; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>${_title}</title>

<!-- Bootstrap core CSS -->

<link href="${_css}/bootstrap.min.css" rel="stylesheet">

<link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
<link href="${_css}/animate.min.css" rel="stylesheet">

<!-- Custom styling plus plugins -->
<link href="${_css}/custom.css" rel="stylesheet">
<link href="${_css}/icheck/flat/green.css" rel="stylesheet">
<link href="${_css}/datatables/tools/css/dataTables.tableTools.css" rel="stylesheet">

<script src="${_js}/jquery.min.js"></script>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
<style>
td a {
	cursor: pointer
}
</style>
</head>


<body style="background: #F7F7F7;">
	<div class="">
		<div class="row">
			<div class="col-md-12 col-sm-12 col-xs-12">
				<div class="x_panel">
					<div class="x_title">
						<h2>所有还款列表</h2>
						<div class="clearfix"></div>
					</div>
					<div class="x_content">
						<div class="x_content">
							<table id="example" data-action="/admin/borrowPayment/list?1=1" 
								class="table table-striped responsive-utilities jambo_table">
								<thead>
									<tr class="headings">
										<th><input type="checkbox" class="tableflat">
										</th>
										<th>序号</th>
										<th>用户</th>
										<th>借款标</th>
										<th>还款期数</th>
										<th>还款金额(￥)</th>
										<th>还款本金(￥)</th>
										<th>还款利息(￥)</th>
										<th>未还总额(￥)</th>
										<th>未还本金(￥)</th>
										<th>未还利息(￥)</th>
										<th>理论还款时间</th>
										<th>实际还款时间</th>
										<th>创建时间</th>
										<th>明细</th>
									</tr>
									</tr>
								</thead>

								<tbody>
									<#if (pageInfo.pageList?size > 0)> 
									<#list pageInfo.pageList as item>
									<tr class="even pointer">
										<td class="a-center "><input type="checkbox" class="tableflat"></td>
										<td>${item_index+1}</td>
										<td>
											<#if item.borrowUserName?exists>
		                                		${item.borrowUserName}
		                                	</#if>
										</td>
										<td>
											<#if item.title?exists>
		                                		${item.title}
		                                	</#if>
										</td>
										<td>
											<#if item.periodIndex?exists>
		                                		${item.periodIndex}期
		                                	</#if>
										</td>
										<td>
											<#if item.paymentTotal?exists>
		                                		<#if (item.paymentTotal != 0 )>
		                                			${item.paymentTotal?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.paymentFund?exists>
		                                		<#if (item.paymentFund != 0 )>
			                                		${item.paymentFund?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.paymentInterest?exists>
		                                		<#if (item.paymentInterest != 0 )>
			                                		${item.paymentInterest?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.notPaymentTotal?exists>
		                                		<#if (item.notPaymentTotal != 0 )>
			                                		${item.notPaymentTotal?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.notPaymentFund?exists>
		                                		<#if (item.notPaymentFund != 0 )>
			                                		${item.notPaymentFund?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.notPaymentInterest?exists>
		                                		<#if (item.notPaymentInterest != 0 )>
			                                		${item.notPaymentInterest?string('0.00')}
			                                	<#else>
			                                	 	0.00
			                                	</#if>
		                                	</#if>
										</td>
										<td>
											<#if item.expectDate?exists>
		                                		${(item.expectDate?string("yyyy-MM-dd HH:mm:ss"))}
		                                	</#if>
										</td>
										<td>
											<#if item.actualDate?exists>
		                                		${(item.actualDate?string("yyyy-MM-dd HH:mm:ss"))}
		                                	</#if>
										</td>
										<!--
										<td>${item.overdueDay!}</td>
										<td>${item.overdueInterest!}</td>
										<td>${item.overdueFee!}</td>
										-->
										<td>
											<#if item.createTime?exists>
		                                		${(item.createTime?string("yyyy-MM-dd HH:mm:ss"))}
		                                	</#if>
										</td>
										<td>
											<a href="/admin/borrowPayment/listBorrowPaymentDetail?paymentId=${item.id }">查看明细</a></td>
									</tr>
									</#list> 
									<#else>
										<tr class="even pointer">
											<td colspan="14">无记录</td>
										</tr>
									</#if>
								</tbody>
							</table>
							<#if (pageInfo.pageList?size > 0)> 
								<#include "../base/Page.ftl"> 
							</#if>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12 col-sm-12 col-xs-12">
			    <div class="ln_solid"></div>
			    <div class="form-group">
			        <div class="col-md-12 col-md-offset-5">
			            <button type="button" onclick="javascript:history.go(-1)" class="btn btn-primary">返回前一页</button>
			        </div>
			    </div>			
			</div>
		</div>
		<script src="${_js}/bootstrap.min.js"></script>

		<!-- bootstrap progress js -->
		<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
		<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
		<!-- icheck -->
		<script src="${_js}/icheck/icheck.min.js" type="text/javascript"></script>

		<script src="${_js}/custom.js" type="text/javascript"></script>

		<!-- PNotify -->
	    <script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
	    <script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
	    <script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>

		<script type="text/javascript">
			$(document).ready(function() {
				$('input.tableflat').iCheck({
					checkboxClass : 'icheckbox_flat-green',
					radioClass : 'iradio_flat-green'
				});
			});

			$(window).load(function() {
				var hash = window.location.hash;
				if (hash != "") {
					hash = hash.substring(1, hash.length);
					$("#payment-tab li").removeClass('active');
					$("#payment-tab li").each(function() {
						var status = $(this).find('a').attr('data-status');
						if (hash == status) {
							$(this).addClass('active');
							var action = $("#example").attr('data-action');
							$("#example").attr('data-action', action + status);
							$("#example").attr('data-hash', status);
							return false;
						}
					})
				}
			});
			$("#payment-tab li").click(
					function() {
						var temp = $("#payment-tab .active").find('a').attr(
								'data-status');
						var status = $(this).find('a').attr('data-status');
						//当前项选中不再做页面刷新，节约资源
						if (temp == status) {
							return false;
						}
						window.location.href = "/admin/borrowPayment/list?status="
								+ status + "#" + status;
					})
					
			function initData(action) { 
				window.location.href=action;
			} 
			
			$(".btn-info").click(function(){
				initData($("#example").attr('data-action'));
			});
		</script>